package com.example.demo.behavior.iterator;

import java.util.ArrayList;
import java.util.List;

/**
 * @Desc:
 * @Author zzz
 * @Date 2021/2/27
 * @Version V1.0
 */
public class MyQueue implements Queue {

    List<Object> list = new ArrayList<>();

    @Override
    public void add(Object obj) {
        list.add(obj);
    }

    @Override
    public void remove(Object obj) {
        list.remove(obj);
    }

    @Override
    public Iterator iterator() {
        return new MyIterator(list);
    }
}
